home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 July / Ahoy_Magazine_87-07_1987_Double_L_Side_A.d64 / Root Power (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  374b  |  15 lines

  1. 0 rem << cd43-8 >>
  2. 1 rem ==================================
  3. 2 rem commodares problem #39-4 :
  4. 3 print"[147]  [210]oot [208]ower"
  5. 4 rem solution by
  6. 5 rem   jim speers
  7. 6 rem ==================================
  8. 100 for i=1 to 256 : k=1 : if sqr(i^2)=i then k=3
  9. 110 if sqr(i*i)=i then k=k+1
  10. 120 on k goto 160,130,140,150
  11. 130 print i;"(i*i) only" : goto 160
  12. 140 print i;"(i^2) only" : goto 160
  13. 150 print i;"both equal"
  14. 160 next i
  15.